#!/bin/bash

# 设置变量
DOCKER_USER="weibozzz/test"
IMAGE_NAME="$DOCKER_USER/rubbish-node"
TAG="latest"

# 登录 Docker Hub
echo "登录 Docker Hub..."
docker login -u $DOCKER_USER

# 设置 buildx
echo "设置 Docker Buildx..."
docker buildx create --use --name mybuilder

# 构建并推送多架构镜像
echo "构建并推送镜像: $IMAGE_NAME:$TAG"
docker buildx build \
  --platform linux/amd64,linux/arm64 \
  --tag "$IMAGE_NAME:$TAG" \
  --push \
  ./rubbish-node

echo "完成!"
